export function queryEventByType(type) {
  //初始化查询结构对象，设置查询结构包含几何信息
  var queryStruct = new window.Zondy.Service.QueryFeatureStruct()
  //是否包含几何图形信息
  queryStruct.IncludeGeometry = true
  //是否包含属性信息
  queryStruct.IncludeAttribute = true
  //是否包含图形显示参数
  queryStruct.IncludeWebGraphic = false
  //实例化查询参数对象
  var queryParam = new window.Zondy.Service.QueryParameter({
    resultFormat: 'json',
    struct: queryStruct,
  })
  //设置查询分页号
  queryParam.pageIndex = 0
  //设置查询要素数目
  queryParam.recordNumber = 25
  //设置属性条件
  queryParam.where = `事件类型 like '%${type}%'`
  //实例化地图文档查询服务对象
  var queryService = new window.Zondy.Service.QueryDocFeature(queryParam, 'guanggu', 2, {
    ip: `localhost`,
    port: `6163`,
  })
  return new Promise((res, rej) => {
    queryService.query(function (data) {
      if (data) {
        const format = new window.Zondy.Format.PolygonJSON()
        const features = format.read(data)
        res(features)
      } else {
        rej('没有找到')
      }
    })
  })
}
